//
//  HotListTableViewCell.m
//  TthMusic
//
//  Created by lanou3g on 15/9/1.
//  Copyright (c) 2015年 陶天海. All rights reserved.
//

#import "FunPicsCell.h"

@implementation FunPicsCell

- (void)translateModel:(FunPicModel *)model tableView:(UITableView *)tableView{
   

   self.songListName.text = model.content;

    
    
   



//    //获取图片
    NSURL *url = [NSURL URLWithString:model.url];
    
    [ self.songsPic sd_setImageWithURL:url placeholderImage :[UIImage imageNamed:@"placeHoderImage.jpg"]];

//    self.songListName = [[MyScollview alloc] initWithFrame:CGRectMake(25+self.songsPic.bounds.size.width, 15, kWidth -self.songsPic.bounds.size.width- 25, 35) str:model.title];
//    [self.contentView addSubview:self.songListName];
//    
//    [tableView reloadData];


}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
            
            
    if (self) {
        
        self.backgroundColor = [UIColor clearColor];
        //选中样式
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        //歌单图片
        self.songsPic = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, kWidth, kWidth/1.7)];
     
        
        [self.contentView addSubview:self.songsPic];
     
        
        //图名
        self.songListName = [[UILabel alloc] initWithFrame:CGRectMake(0, 10+self.songsPic.bounds.size.height, kWidth/1.5, 35)];
          self.songListName.font = [UIFont boldSystemFontOfSize:18];
        //self.songListName.userInteractionEnabled = NO;
        // self.songListName.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:self.songListName];
        
        
        
        //分割线
        UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(25, 5+self.songsPic.bounds.size.height, kWidth, 1)];
//        //歌单简介
//        self.songsIntroduce = [[UILabel alloc] initWithFrame:CGRectMake(25+self.songsPic.bounds.size.width, self.songListName.bounds.size.height + 20, self.songListName.bounds.size.width - 25, 100)];
        //音符图标
        self.songsIcon = [UIButton buttonWithType:(UIButtonTypeSystem)];
                          
                          
                          
                    self.songsIcon.frame = CGRectMake(50 + self.songListName.bounds.size.width, 10+self.songsPic.bounds.size.height, 35, 35);
        //听众数
        self.songserCount = [[UILabel alloc] initWithFrame:CGRectMake(55 + self.songsPic.bounds.size.width, self.songsPic.bounds.size.height+40, 100, 30)];
        self.songsPic.backgroundColor = [UIColor redColor];
        lineView.backgroundColor = [UIColor blackColor];
        //self.songListName.backgroundColor = [UIColor blueColor];
         [self.songsIcon setBackgroundImage:  [UIImage imageNamed:@"loveago.png"] forState:(UIControlStateNormal)];
        [self.songsIcon setBackgroundImage: [UIImage imageNamed:@"love.png"] forState:(UIControlStateSelected)];

        self.songsIcon.layer.masksToBounds = YES;
        self.songsIcon.layer.cornerRadius = 20;
        self.songsIcon.selected = NO;
      
        [self  setUpSongserCount:self.songserCount];
     
        [self.contentView addSubview:self.songsIcon];
        
        [self.contentView addSubview:lineView];
        
        
        
    }
    return self;
}
//设置歌单图

//- (void)setUpSongsPic:(UIImageView *)songsPic {
////允许设置
//    songsPic.layer.masksToBounds = YES;
//    songsPic.layer.borderWidth = 2;//layer边框宽度
//    songsPic.layer.cornerRadius = songsPic.bounds.size.height / 2;//圆形
//    songsPic.layer.borderColor = [[UIColor whiteColor] CGColor];//边框色
//    [self.contentView addSubview:songsPic];
//
//
//
//
//
//
//}
//设置歌单名
//- (void)setUpSongsListName:(UIScrollView *)songsListName {
//
//    //设置文本色
//    songsListName.textColor = [UIColor whiteColor];
//    //字体
//    songsListName.font = [UIFont boldSystemFontOfSize:15.0];
//    //设置文本字体居左
//    songsListName.textAlignment = NSTextAlignmentLeft;
//    
//    
//    MyScollview *myscoll = [MyScollview]
//    
//    
//    [self.contentView addSubview:songsListName];
//
//
//
//}
- (void)setUpSongsIntroduce:(UILabel *)songIntroduce {
 
    
    songIntroduce.text = @"2015-09-01 11:43:17.314 TthMusic[1125:42736] <UIVisualEffectView 0x7f86d1d74a40> is being asked to animate its opacity. This will cause the effect to appear broken until opacity returns to 1";
    
    
    //换行
    songIntroduce.numberOfLines = 0;
    //文本颜色
    songIntroduce.textColor = [UIColor whiteColor];
    //设置字体
    songIntroduce.font = [UIFont boldSystemFontOfSize:12.0];
    [self.contentView addSubview:songIntroduce];
}

//听众数字
- (void)setUpSongserCount:(UILabel *)songserCount {

    songserCount.textColor = [UIColor whiteColor];
    songserCount.font = [UIFont boldSystemFontOfSize:12.0];
    [self.contentView addSubview:songserCount];
    




}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
